package com.ruoyi.system.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BizBuildingMapper;
import com.ruoyi.system.domain.BizBuilding;
import com.ruoyi.system.service.IBizBuildingService;

/**
 * 楼栋Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-25
 */
@Service
public class BizBuildingServiceImpl implements IBizBuildingService
{
    @Autowired
    private BizBuildingMapper bizBuildingMapper;

    /**
     * 查询楼栋
     *
     * @param id 楼栋主键
     * @return 楼栋
     */
    @Override
    public BizBuilding selectBizBuildingById(String id)
    {
        return bizBuildingMapper.selectBizBuildingById(id);
    }

    /**
     * 查询楼栋列表
     *
     * @param bizBuilding 楼栋
     * @return 楼栋
     */
    @Override
    public List<BizBuilding> selectBizBuildingList(BizBuilding bizBuilding)
    {
        return bizBuildingMapper.selectBizBuildingList(bizBuilding);
    }

    /**
     * 新增楼栋
     *
     * @param bizBuilding 楼栋
     * @return 结果
     */
    @Override
    public int insertBizBuilding(BizBuilding bizBuilding)
    {
        String id = IdUtil.getSnowflakeNextIdStr();
        bizBuilding.setId(id);
        return bizBuildingMapper.insertBizBuilding(bizBuilding);
    }

    /**
     * 修改楼栋
     *
     * @param bizBuilding 楼栋
     * @return 结果
     */
    @Override
    public int updateBizBuilding(BizBuilding bizBuilding)
    {
        return bizBuildingMapper.updateBizBuilding(bizBuilding);
    }

    /**
     * 批量删除楼栋
     *
     * @param ids 需要删除的楼栋主键
     * @return 结果
     */
    @Override
    public int deleteBizBuildingByIds(String[] ids)
    {
        return bizBuildingMapper.deleteBizBuildingByIds(ids);
    }

    /**
     * 删除楼栋信息
     *
     * @param id 楼栋主键
     * @return 结果
     */
    @Override
    public int deleteBizBuildingById(String id)
    {
        return bizBuildingMapper.deleteBizBuildingById(id);
    }
}
